package com.youkeda.DesertCamel.controller;

import com.youkeda.DesertCamel.model.CompanyParam;
import com.youkeda.DesertCamel.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CompanyController {

    @Autowired
    private CompanyService companyService;

    // todo 没有写全注释

    /**
     * 获取获取公司信息
     * @param companyParam
     * @return
     */
    @RequestMapping(value = "/company/getCompany", method = RequestMethod.POST)
    public Result getCompany(@RequestBody CompanyParam companyParam){
        Result result = new Result();
        if(companyParam != null) {
            result = companyService.getCompany(companyParam.getCompanyId());
        }else{
            result.setSuccess(false);
        }
        return result;
    }
}
